<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="lib/vue.js"></script>
</head>

<body>
    <div id="app">
<input type="button" value="v-on单击" @click="doIt">
<h4 @click="changeFood">{{food}}</h4>
    </div>
    
    <script>
        var vm = new Vue({
            el:"#app",
            data:{
                food:"不爱了"

            },
            methods:{
                doIt:function(){
                    alert("123456")
                },
                changeFood(){
                    this.food+="哎哎哎"
                }
        
            }
        })
    </script>
    
</body>
</html>